Python and curl equivalent